package functional_programming;

public class PrintableDemo {
    public static void main(String[] args) {
        usePrintable((s) -> System.out.println(s));
        String str = "通过方法引用符\"::\"来引用已经存在的方法";
        usePrintable(System.out::println, str);
    }

    private static void usePrintable(FuncInterface<String> p){
        p.consume("hello world");
    }

    private static void usePrintable(FuncInterface<String> p, String str){
        p.consume(str);
    }
}
